// import { Component } from '@angular/core';

// @Component({
//   selector: 'app-tom',
//   standalone: true,
//   imports: [],
//   templateUrl: './tom.component.html',
//   styleUrl: './tom.component.css'
// })
// export class TomComponent {

// }
import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { Component } from '@angular/core';

import { NzTableModule } from 'ng-zorro-antd/table';

@Component({
  selector: 'app-list3',
  standalone: true,
  imports: [CdkDropList, CdkDrag, NzTableModule],
  templateUrl: './list3.component.html',
  styleUrl: './list3.component.css'
})
export class List3Component {
  listOfData = [
    {
      key: '1',
      name: 'John Brown',
      age: 32,
      address: 'New York No. 1 Lake Park'
    },
    {
      key: '2',
      name: 'Jim Green',
      age: 42,
      address: 'London No. 1 Lake Park'
    },
    {
      key: '3',
      name: 'Joe Black',
      age: 32,
      address: 'Sidney No. 1 Lake Park'
    }
  ];

  drop(event: CdkDragDrop<string[]>): void {
    moveItemInArray(this.listOfData, event.previousIndex, event.currentIndex);
  }
}